package com.xbang.attendance.web.action.system.department;

import com.demo2do.lighturl.annotation.Action;
import com.xbang.attendance.entity.department.Department;
import com.xbang.attendance.entity.system.Warehouse;
import com.xbang.attendance.service.SystemService;
import com.xbang.core.struts.support.BaseActionSupport;

public class DepartmentManager extends BaseActionSupport {
	private Department dinfo;
	private SystemService systemService;
	public Department getDinfo() {
		return dinfo;
	}

	public void setDinfo(Department dinfo) {
		this.dinfo = dinfo;
	}
	@Action("/system/department/add")
	public String add() throws Exception {
		
//		categorys = productService.getObjects(ProductCategory.class);
		return "detail";
	}
	
	@Action("/system/department/save")
	public String save() throws Exception{
		if (null != dinfo) {
			systemService.save(dinfo);
		}
		return "r:/system/department/list";
	}

	public void setSystemService(SystemService systemService) {
		this.systemService = systemService;
	}
	private Integer id;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
/*
	@Action("/system/department/${id}/delete")
	public String delete() throws Exception {
		if (id != null) {
			 dinfo= (Department) systemService.getObject(Department.class, id);
			systemService.delete(dinfo);
		}
		return "r:/system/setuphouse/list";
	}*/
}
